<template>
    <div class="box_details"
         v-if="skeleton"
         :class="{'global_log':$store.state.nowTime==='moon'}">
        <h2 :class="{'global_font':$store.state.nowTime==='moon'}">{{ content_.title }}</h2>
        <hr>
        <p  v-html="content_.content" :class="{'global_font':$store.state.nowTime==='moon'}"></p>
        <div class="operate">
            <img src="/img/common/sq_liulan.png" alt=""
                 :class="{'global_font':$store.state.nowTime==='moon'}"
                 style="width:20px"  >发布时间：{{content_.releaseTime}}
        </div>
        <span @click="shutDown_"
              :class="{'global_font':$store.state.nowTime==='moon'}"
              class="shutDown">x</span>
    </div>
    <div v-else class="box_details">
        <div class="circle_box">
            <CircleLoading></CircleLoading>
        </div>
    </div>
</template>

<script>
import CircleLoading from "@/components/PublicComponents/CircleLoading.vue";

export default {
    name: "AnnouncementDetails",
    components: {CircleLoading},
    props: ['content_'],
    data(){
      return{
          skeleton:false,
      }
    },
    methods: {
        shutDown_() {
            this.$emit("shutDown");
        },
    },
    watch:{
        content_(newValue,oldValue){
            if(newValue !== ""){
                setTimeout(()=>{
                    this.skeleton = true
                },100)
            }
        }
    },
}
</script>

<style scoped>
.circle_box{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius:5px;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    background: rgba(246, 247, 248, 0.7);
}
.box_details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 60vw;
    height: 60vh;
    min-width: 350px;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.9);
    color: #fdfcfc;
    margin: auto;
    padding: 15px;
    animation: box_ 0.3s linear 0s 1 forwards;
    z-index: 2;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2), 0 2px 10px 0 rgba(0, 0, 0, 0.19);
}

@keyframes box_ {
    0% {
        transform: translateX(-50%) translateY(-50%) scale(0);
    }
    70% {
        transform: translateX(-50%) translateY(-50%) scale(110%);
    }
    100% {
        transform: translateX(-50%) translateY(-50%) scale(100%);
    }

}

h2 {
    font-weight: bold;
    color: #282828;
    height: 30px;
}
hr{
    margin: 10px 0;
}
p {
    text-indent: 0.8rem;
    color: #282828;
    height: 83%;
    overflow: auto;
    font-size: 17px;
    letter-spacing: 2px;
    word-break: break-all;
}
p::-webkit-scrollbar {
    width: 6px;
}
p::-webkit-scrollbar-thumb {
    background: #a8a6a7;
}
p::-webkit-scrollbar-track {
    border-radius: 0;
    background: #f9f9fc;
}
.shutDown {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 3px;
    color: #504e4e;
}

.shutDown:hover {
    background: rgba(147, 144, 144, 0.7);

}

.operate {
    display: flex;
    justify-content: left;
    align-items: center;
    text-align: right;
    width: 100%;
    font-size: 14px;
    padding-right: 15px;
    margin: 2px 0;
    color: #504e4e;
}

@media (min-width: 900px) and (max-width: 800px) {
    .box, .box_content_left, .box_content_right {
        width: 600px;
    }
}
</style>